<extend name="Public/user"/>
<block name="link">
	<title>我要下单</title>
	<link href="/static/lida/css/tran_style.css" rel="stylesheet" type="text/css" />
	<link href="__CSS__/bootstrap.min.css" rel="stylesheet"/>
	<script src="__JS__/jquery.js"></script>
	<script src="__JS__/bootstrap.js"></script>
	<link href="__CSS__/ksfh-style.css" rel="stylesheet"/>
	<link rel="stylesheet" type="text/css" href="__CSS__/common.css">
</block>
<block name="user-right">
	<style type="text/css">
		.address-form{
			position: absolute;
			width: 270px;
			padding: 20px;
			border: 1px solid red;
			top: -1px;
			left: -1px;
			background: #fff;
			min-height: 160px;
			display: none;
			z-index: 1000;
		}
		form{
			margin: 0;
			padding: 0;
			border: none;
			list-style-type: none;

		}
		.user-right .user-address .address-form input[type="text"]{
			width: 96%;
			padding: 2%;
			border: 1px solid #dfdfdf;
		}
		.blank{height: 10px;clear: both;}
		.btnqx{background: #fafafa;border: 1px solid #dfdfdf;width: 48%;padding: 5px 0;float: left;cursor: pointer;text-align: center;}
		.btnqd{background: #fafafa;border: 1px solid red;width: 48%;padding: 5px 0;float: right;background: red;color:#fff;cursor: pointer;text-align: center;}
	</style>
	<script type="text/javascript" src="__STATIC__/thinkbox/thinkbox/jquery.thinkbox.js"></script>
	<!--main_right-->
	<div class="main_r f_fr">
		<div class="user_kx">
			<h3 class="user_kx_title">
				可选包裹

			</h3>
			<table class="table table-striped table-bordered">

				<tbody>
				<tr>
					<th class="w90">{:lang('ex_num')}</th>
					<th class="w80">{:lang('baoguo_name')}</th>
					<th class="w70">{:lang('jiazhi')}(日元)</th>
					<th class="w60">{:lang('baoguo_leixing')}</th>
					<th>{:lang('remark')}</th>
					<th class="w50">{:lang('status')}</th>
					<th class="w80">{:lang('add_time')}</th>
					<th class="w80">{:lang('operation')}</th>
				</tr>
				<if condition="$list">
					<volist name="list" id="v">

						<tr class=""  id='yubao_info_{$v.id}'  <eq name="v.baoguo_type" value="1">style="background:#FFFFE7;color:red;"</eq>>
						<td>{$v.kuaidi_sn}</td>
						<td>{$v.baoguo_name}</td>
						<td>{$v.jiazhi}</td>
						<td><eq name="v.baoguo_type" value="0">{:lang('common_goods')}</eq><eq name="v.baoguo_type" value="1">{:lang('sensitive_goods')}</eq></td>
						<td>{$v.remark}</td>
						<td>{$v.status|getyubaostatus}</td>
						<td>{$v.add_time|time_format='Y-m-d'}</td>
						<td>
							<a href="###" title="{:lang('delete')}" class="tjdd add_yundan" did="{$v.id}">添加到订单</a>
						</td>
						</tr>
					</volist>
					<else />
					<tr >
						<td style="padding:5px;text-align: center; line-height:16px;" colspan="11">暂时没有信息</td>
					</tr>
				</if>
				</tbody>


			</table>
			<div>{$_page} </div>
		</div>
		<style type="text/css">
			.addedcell{position: relative;}
			.addedcell .delcell{position: absolute;top: 1px;right: 0;display: block;background: red;color: #fff;padding: 2px 10px;height: 16px;line-height: 16px;}
			.listcell{position: relative;}
			.listcell .dellistcell{position: absolute;top: 1px;right: 0;display: block;background: red;color: #fff;padding: 2px 10px;height: 16px;line-height: 16px;}
			#addresslist{display: none;position: relative;}
			.yubao-add .address-form{position: absolute;width: 285px;padding: 20px;border: 1px solid red;bottom: -35px;left: -1px;background: #fff;min-height: 160px;display: none;}
			.yubao-add .address-form input[type="text"]{width: 96%;padding: 2%;border: 1px solid #dfdfdf;}
			.yubao-add .address-form select{border: 1px solid #dfdfdf;}

		</style>
		<div id="addresslist">
			<ul>
				<li style="padding: 5px 0;border-bottom: 1px dashed #dfdfdf;">
											<span style="float: left;display:block;width: 25px;padding: 10px 0;">
												<input name="id" value="70" class="addressid" checked="" type="radio">
										</span>
										<span style="float: left;display: block;width: 295px;">
											111 (00000)&nbsp;中国 &nbsp; 上海3466 (200000)
										</span>
					<div class="clear"></div>
				</li>
			</ul>
			<div class="blank"></div>
			<a href="###" class="btnqx addnewaddress">使用新地址</a>
			<a href="###" class="btnqd querenaddress">确认选择</a>
			<div class="address-form">

				<input name="consignee" placeholder="收货人" type="text">
				<div class="blank"></div>
				<input name="tel" placeholder="手机号码" type="text">
				<div class="blank"></div>
				<select name="areaid" style="width:100%;">
					<option value="0">选择国家</option>
					<option value="1">中国</option>								</select>
				<div class="blank"></div>
				<textarea name="address" placeholder="城市，街道，门牌号等" style="width: 96%;padding: 2%;"></textarea>
				<div class="blank"></div>
				<input name="zipcode" placeholder="邮政编码" type="text">
				<div class="blank"></div>
				<div style="">
					<button type="button" class="btnqx quxiaoaddaddress">取消</button>
					<button type="button" class="btnqd querenaddaddress">确认收货地址</button>
				</div>

			</div>
		</div>
		<div class="user_kx">
			<h3 class="user_kx_title">
				{:lang('daiyun_order')}
			</h3>
			<form class="form-inline" method="post" action="{:url('User/yubaocartonly')}" id="ybcartadd">
				<table class="yubao-add table table-striped table-bordered" id="yubaoinput" style="border:none;">
					<tbody>
					<tr>
						<th class="w100">{:lang('ex_num')}*</th>
						<th class="w100">货物品名及数量*</th>
						<th class="w70">{:lang('jiazhi')}(日元)</th>
<!--
						<th class="w80">{:lang('baoguo_leixing')}</th>
-->
						<!--
                        <th width="75">原箱/合箱</th>
                        -->
						<th >{:lang('remark')}</th>

					</tr>
					<tr>
						<td>
							<input type="text" class="form-control" name="kuaidi_sn[]"  placeholder="{:lang('ex_num')}">

						</td>
						<td>
							<input type="text" class="form-control" name="baoguo_name[]"  placeholder="货物品名及数量">
						</td>
						<td>
							<input type="text" class="form-control" name="jiazhi[]" onkeyup="fillNumOnly(this)"  placeholder="{:lang('jiazhi')}(日元)">
						</td>
					<!--	<td >
							<select name="baoguo_type[]" class="form-control"  >
								<option value="0">{:lang('common_goods')}</option>
								<option value="1">{:lang('sensitive_goods')}</option>
							</select>
						</td>-->

						<td>
							<div class="input-group">
								<input type="text" name="remark[]" class="form-control" id="inputGroupSuccess1" aria-describedby="inputGroupSuccess1Status" placeholder="{:lang('remark')}">

							</div>

						</td>

					</tr>

					</tbody>
				</table>
				<div class="user_btn">

					<button type="button" class=" addonecell btn btn-default">{:lang('add_cell')}</button>
					<button type="button" class=" ybcartinbtn btn btn-danger" style="background:#F00;">{:lang('insert_order')}</button>
				</div>
			</form>

		</div>
		<div class="user_kx">
			<h3 class="user_kx_title">
				{:lang('order_info')}
			</h3>
			<form action="{:url('User/yubaoadd')}" method="post" >
				<table class="table table-striped table-bordered" id='yubao-adds' style="border:none;">
					<tbody>
					<tr>
						<!-- 	<th width="75">{:lang('ex_name')}</th>-->
						<th class="w100">{:lang('ex_num')}</th>
						<th class="w100">货物品名及数量</th>
						<th class="w70">{:lang('jiazhi')}(日元)</th>
						<th class="w80">{:lang('baoguo_leixing')}</th>
						<!--
                        <th width="75">原箱/合箱</th>
                        -->
						<th class="w50">状态</th>
						<th  class="w100">{:lang('remark')}</th>
					</tr>
					<if condition="$ybcart">
						<volist name="ybcart" id="v">
							<tr>
								<!-- 	<td>
										<input type="text" name="kuaidi_name" class="listkdname" value="{$v.kuaidi_name}" placeholder="{:lang('ex_name')}"></td>
									--><td>
								<input type="text" name="kuaidi_sn" class="form-control" value="{$v.kuaidi_sn}" placeholder="{:lang('ex_num')}"></td>
								<td>
									<input type="text" name="baoguo_name" class="form-control" value="{$v.baoguo_name}" placeholder="货物品名及数量"></td>
								<td>
									<input type="text" name="jiazhi" class="form-control" value="{$v.jiazhi}" placeholder="{:lang('jiazhi')}(日元)"></td>
								<td>
									<select name="baoguo_type" class="form-control">
										<option value="0" <eq name="v.baoguo_type" value="0">selected</eq>
										>{:lang('common_goods')}
										</option>
										<option value="1" <eq name="v.baoguo_type" value="1">selected</eq>
										>{:lang('sensitive_goods')}
										</option>
									</select>
								</td>
								<td>{$v.status|getyubaostatus}</td>
								<td class="listcell">
									<input type="text" name="remark" class="form-control" value="{$v.remark}" placeholder="{:lang('remark')}">
									<a href="###" class="dellistcell">{:lang('delete')}</a>
								</td>
								<input type="hidden" name="id" value="{$v.id}" class="listid form-control"></tr>
						</volist>
						<else />
						<tr>
							<td colspan="8" id="no_infos" style="padding:5px;text-align: center;">{:lang('no_infos')}</td>
						</tr>
					</if>
					</tbody>
				</table>
				<table class="table table-striped table-bordered">
					<tbody>
					<tr>
						<th style="width:50%; text-align:center;">{:lang('delivery_address')}</th>
						<th style="width:50%; text-align:center;">{:lang('shipping_method')}</th>
						<!--
                       </td>-->
					</tr>
					<tr>
						<td style="width:50%;border:none; border-right:1px solid #CCC; padding:10px; border-bottom:1px solid #CCC;">
							<div style="line-height:25px;" id="defaddress">
								<if condition="$address">
									<div style="margin-bottom: 20px;">
										{:lang('consignee')}：{$address.consignee} &nbsp;&nbsp;{:lang('telphone')}：{$address.tel}<br>
										{:lang('country')}：{$address.areaname} {$address.city} <br>
										{:lang('address')}：{$address.address} ({$address.zipcode}) <br>
									</div>
								</if>
								<input type="hidden" name="addressid" id="addressinputid" value="{$address.id}">
								<a href="###" id="newaddress" style=" color:#F00;">{:lang('check')}{:lang('delivery_address')}</a>
							</div>
							<div id="addresslist">
								<ul>
									<volist name="addresslist" id="v">
										<li style="padding: 5px 0;border-bottom: 1px dashed #dfdfdf;">
											<span style="float: left;display:block;width: 25px;padding: 10px 0;">
												<input type="radio" name="id" value="{$v.id}" class="addressid" <eq name="v.def" value="1">checked</eq>
											>
										</span>
										<span style="float: left;display: block;width: 295px;">
											{$v.consignee} ({$v.tel})&nbsp;{$v.areaname} &nbsp; {$v.address} ({$v.zipcode})
										</span>
											<div class="clear"></div>
										</li>
									</volist>

								</ul>
								<div class="blank"></div>
								<a href="###" class="btnqx addnewaddress">{:lang('new_address')}</a>
								<a href="###" class="btnqd querenaddress">{:lang('confirm_select')}</a>
								<div class="address-form">

									<input type="text" name="consignee"  placeholder="{:lang('consignee')}">
									<div class="blank"></div>
									<input type="text" name="tel"  placeholder="{:lang('mobile')}">
									<div class="blank"></div>
									<select name="areaid" style="width:100%;">
										<option value="0">{:lang('select_country')}</option>
										<volist name=":config('AREA_INFO')" id="v">
											<option value="{$key}">{$v}</option>
										</volist>
									</select>
									<div class="blank"></div>
									<textarea name="address" placeholder="{:lang('city_street')}" style="width: 96%;padding: 2%;"></textarea>
									<div class="blank"></div>
									<input type="text" name="zipcode" placeholder="{:lang('zipcode')}">
									<div class="blank"></div>
									<div style="">
										<button type="button" class="btnqx quxiaoaddaddress">{:lang('cancel')}</button>
										<button type="button" class="btnqd querenaddaddress">{:lang('confirm_address')}</button>
									</div>

								</div>
							</div>
						</td>

						<td style="width:50%;border:none; padding:20px 50px;">
							<if condition="$delivery">
								<volist name="delivery" id="d">

									<div class="radio"><input type="radio" name="deliveryid" <eq name='key' value='0'>checked</eq>   value="{$d.id}"> &nbsp;{$d.dname} (<a href="{$d.uri}" target="_blank">{:lang(official_website)}</a>)</div>
								</volist>
								<else />
								{:lang('select_address_first')}
							</if>
						</td>

					</tr>

					</tbody>
				</table>

				<table class="table table-bordered">
					<tbody>
					<tr>
						<td>

							<div class="checkbox">
								<label>
									<input type="checkbox" name="yunfei"   value="1" >同意直接扣除运费快速发货（余额大于{:config('ZHUANYUN_LOW_YUNFEI')}日元）
								</label>
							</div>

						</td>
					</tr>
					<tr>
						<td>
							<span style="color:#F00;"><strong>选择增值服务：</strong></span>
							<input type="radio" name="jiagu"  checked="checked" value="-1" style="margin-right:5px;" >无需加固（0日元）
							<input type="radio" name="jiagu"  value="0"  style="margin-right:5px;">简易加固（{:config('ZHUANYUN_JIAGU_EASY')}日元）
							<input type="radio" name="jiagu"   value="1"  style="margin-right:5px;">超级加固（<php>echo C('ZHUANYUN_JIAGU_2')+C('ZHUANYUN_JIAGU_2_LEVEL')</php>日元起，每5kg增加{:config('ZHUANYUN_JIAGU_2_LEVEL')}日元）<br><br>
						</td>
					</tr>
					<tr>
						<td>
							<span style="color:#F00;"><strong>加急服务：</strong></span>

							<label>
								<input type="checkbox" name="jiaji"   value="1"  style="margin-right:5px;">加急（{:config('ZHUANYUN_JIAJI')}日元）
							</label>


						</td>
					</tr>
					<tr>
						<td>
							<span style="color:#F00;"><strong>保价服务：</strong></span>

							<label class="radio-inline">
								<input type="radio" name="baojia"  id='baojiac'  checked="checked" value="0" style="margin-right:3px;" >无需保价
							</label>
							<label class="radio-inline">
								<input type="radio" name="baojia" id='baojiac'  value="1" style="margin-right:5px;"  >保价
							</label>


						</td>
					</tr>
					<tr>
						<td>
							<div class="form-group">
								<label for="exampleInputName2">
									<span style="color:#F00;"><strong>{:lang('all_jiazhi')}：</strong></span>
								</label>
								<input type="text"  onkeyup="baojiafei(this);"   style='width: 30%;border:dotted  #009;' id='allshenbao' name='allshenbao' value='1'> (日元)
							</div>
							<div class="form-group">
								<label for="exampleInputEmail2">(日元)预计保价费 :<span id='baojiafei'>0</span>&nbsp;(日元)   </label>

							</div>


						</td>
					</tr>
					<tr>
						<td>
							<span style="float:left;">{:lang('remark')}</span><textarea name="remark" class="form-control" rows="3" id="dingdanremark" placeholder="{:lang('remark')}"></textarea>
						</td>
					</tr>
					</tbody>
				</table>
				<div class="user_tj f_fr">
					<button type="button" class="btn btn-default tijiaodingdan" style="background:#F00;">{:lang('submit_order')}</button>
				</div>
			</form>
		</div>
	</div>
</block>
<block name="javascript">
	<script type="text/javascript">
		$('.add_yundan').click(function(){
			var id=$(this).attr('did');
			$("#yubao_info_"+id).remove();
			$.post("{:url('User/select')}",{'yubao_id':id,'selected':1},function(result){
				if (result.status) {
					$('#no_infos').empty();
					$('#yubao-adds').append(result.info);
					$('.listkdname,.listkdsn,.listbgname,.listshenbao,.listbgleixing,.listchaibao,.listremark').change(function(){
						var id=$(this).parent().parent().find('.listid').val();
						var field=$(this).attr('name');
						var value=$(this).val();
						var item=$(this);
						$.post("{:url('User/yubaocartedit')}",{'id':id,'field':field,'value':value},function(data,item){
							if (data.status) {
								var allshenbao1=0;
								$('.listshenbao').each(function(){
									allshenbao1+= parseFloat($(this).val());
								});
								allshenbao1=allshenbao1.toFixed(2);
								$('#allshenbao').html(allshenbao1);
							}else{
								result=data.info;
								$('.listid').each(function(){
									if (result.data.id==$(this).val()) {
										$(this).parent().find('.list'+result.field).val(result['data'][result.field]).focus();
									};
								})
								$.thinkbox.error(result.info);
							};
						})
					})
					$('.dellistcell').click(function(){
						$.post("{:url('User/yubaocartdel')}",{'id':id},function(data){
							if (data.status) {
								$('.listid').each(function(){
									if (data.info==$(this).val()) {
										$(this).parent().remove();
									};
									location.reload();
								})
							}else{
								$.thinkbox.error(data.info);
							};
						});
					})
				}else{
					$.thinkbox.error(result.info);
				};
			})


		});
		function baojiafei(obj){
			var str = obj.value;
			if (str.trim == "")
				return;
			if (/[^0-9]/g.test(str)) {
				obj.value = str.substr(0, str.length - 1);
			}
			if($('input[name="baojia"]:checked').val()==0){
				return ;
			}
			var deliveryid=$('input[name="deliveryid"]:checked').val();
			if(!deliveryid){
				$.thinkbox.error('请选择您的运送方式！');
			}else{
				var allbaojia=0;
				var allshenbao=$('#allshenbao').val();
				if(deliveryid==8){
					if(allshenbao>2000000){
						$('#allshenbao').val(2000000);
						$.thinkbox.error('EMS快递总申报价格不能超过200万日元');
					}
				}else{
					if(allshenbao>130000){
						$('#allshenbao').val(130000);
						$.thinkbox.error('国际小包申报价格不能超过130000日元');
					}
				}

				if(deliveryid!=8){
					allbaojia=400+allbaojia;
				}
				if(allshenbao>20000){
					allbaojia=allbaojia+(Math.ceil((allshenbao-20000)/20000))*{:config('ZHUANYUN_BAOJIA')};
				}
				$('#baojiafei').html(allbaojia);
			}
		}

		$("input[name=deliveryid]").click(function(){
			baojiafei();
		});
		$("input[id=baojiac]").click(function(){
			if($('input[name="baojia"]:checked').val()==1){
				baojiafei();
			}
		});


		$(function(){
			var allshenbao=0;
			$('.listshenbao').each(function(){
				allshenbao+= parseFloat($(this).val());
			});
			if(allshenbao==0){
				allshenbao=1;
			}
			$('#allshenbao').val(allshenbao);
			$('.tijiaodingdan').click(function(){
				var addressid=$('#addressinputid').val();
				var deliveryid=$('input[name="deliveryid"]:checked').val();
				if($('input[name="yunfei"]:checked').val()){
					var yunfei=$('input[name="yunfei"]:checked').val();
					if({$member.available_predeposit}<={:config('ZHUANYUN_LOW_YUNFEI')}){
					$.thinkbox.error('您的余额不足'+{:config('ZHUANYUN_LOW_YUNFEI')}+'，无法选择该项服务！');
					return;
				}
				}else{
					var yunfei=0;
				}
				if($('input[name="jiaji"]:checked').val()){
				var jiaji=$('input[name="jiaji"]:checked').val();
			}else{
				var jiaji=0;
			}
			if($('input[name="baojia"]:checked').val()){
				var baojia=$('input[name="baojia"]:checked').val();
			}else{
				var baojia=0;
			}
			var jiagu=$('input[name="jiagu"]:checked').val();
			var remark=$('#dingdanremark').val();
			var allshenbao=$('#allshenbao').val();

			$.post("{:url('User/yubaoadd')}",{'addressid':addressid,'deliveryid':deliveryid,'remark':remark,'pay_yunfei':yunfei,'fuwu_jiaji':jiaji,'fuwu_baojia':baojia,'fuwu_jiagu':jiagu,'allshenbao':allshenbao},function(data){
				if (data.status) {
					$.thinkbox.success(data.info);
					setTimeout(jumpurl(data.url),1000);
				}else{
					$.thinkbox.error(data.info);
				};
			});
		})
		$('.listkdname,.listkdsn,.listbgname,.listshenbao,.listbgleixing,.listchaibao,.listremark').change(function(){
			var id=$(this).parent().parent().find('.listid').val();
			var field=$(this).attr('name');
			var value=$(this).val();
			var item=$(this);
			$.post("{:url('User/yubaocartedit')}",{'id':id,'field':field,'value':value},function(data,item){
				if (data.status) {
					var allshenbao1=0;
					$('.listshenbao').each(function(){
						allshenbao1+= parseFloat($(this).val());
					});
					allshenbao1=allshenbao1.toFixed(2);
					$('#allshenbao').html(allshenbao1);
				}else{
					result=data.info;
					$('.listid').each(function(){
						if (result.data.id==$(this).val()) {
							$(this).parent().find('.list'+result.field).val(result['data'][result.field]).focus();
						};
					})
					$.thinkbox.error(result.info);
				};
			})
		})
		$('.dellistcell').click(function(){
			var id=$(this).parent().parent().find('.listid').val();
			$.post("{:url('User/yubaocartdel')}",{'id':id},function(data){
				if (data.status) {
					$('.listid').each(function(){
						if (data.info==$(this).val()) {
							$(this).parent().remove();
						};
						 location.reload();
					})
				}else{
					$.thinkbox.error(data.info);
				};
			});
		})
		$('#newaddress').click(function(){
			$(this).parent().hide();
			$(this).parent().next().show();
		})
		$('.querenaddress').click(function(){
			var id=$('.addressid:checked').val();
			$.post("{:url('User/changeaddress')}",{'id':id},function(data){
				if (data.status) {
					$.thinkbox.success(data.info);
					setTimeout('location.reload()',700);
				};
				})
				})
				$('.addnewaddress').click(function(){
			$(this).parent().find('.address-form').show();
		})
		$('.quxiaoaddaddress').click(function(){
			$(this).parents('.address-form').hide();
		})
		$('.querenaddaddress').click(function(){
			var consignee=$(this).parents('.address-form').find('input[name="consignee"]').val();
				var tel=$(this).parents('.address-form').find('input[name="tel"]').val();
				var areaid=$(this).parents('.address-form').find('select[name="areaid"]').val();
				var address=$(this).parents('.address-form').find('textarea[name="address"]').val();
				var zipcode=$(this).parents('.address-form').find('input[name="zipcode"]').val();
				$.post("{:url('User/addressadd')}",{'consignee':consignee,'tel':tel,'areaid':areaid,'address':address,'zipcode':zipcode},function(data){
				if (data.status) {
						$.thinkbox.success(data.info);
						setTimeout('location.reload()',700);
					}else{
						$.thinkbox.error(data.info);
					};
			})
		})
		$('.ybcartinbtn').click(function(){
			$('#ybcartadd').submit();
		})
		$('.addonecell').click(function(){
		//	var html='<tr><td><input type="text" name="kuaidi_name[]"  placeholder="{:lang(\'ex_name\')}"></td><td><input type="text" name="kuaidi_sn[]"  placeholder="{:lang(\'ex_num\')}"></td><td><input type="text" name="baoguo_name[]"  placeholder="货物品名及数量"></td><td><input type="text" name="jiazhi[]"  placeholder="{:lang(\'jiazhi\')}(日元)"></td><td><select name="baoguo_type[]"><option value="0">{:lang(\'common_goods\')}</option><option value="1">{:lang(\'sensitive_goods\')}</option></select></td><td><select name="is_chaibao[]"><option value="0">原箱</option><option value="1" selected>合箱</option></select></td><td  class="addedcell"><input type="text" name="remark[]" placeholder="{:lang(\'remark\')}"><a href="###" class="delcell">{:lang(\'delete\')}</a></td></tr>';
					var html='<tr><td><input type="text" class="form-control" name="kuaidi_sn[]"  placeholder="{:lang(\'ex_num\')}"></td><td><input type="text" class="form-control" name="baoguo_name[]"  placeholder="货物品名及数量"></td><td><input type="text" class="form-control" name="jiazhi[]" onkeyup="fillNumOnly(this)"  placeholder="{:lang(\'jiazhi\')}(日元)"></td><td ><select name="baoguo_type[]" class="form-control"  ><option value="0">{:lang(\'common_goods\')}</option><option value="1">{:lang(\'sensitive_goods\')}</option></select></td><td><div class="input-group"><input type="text" name="remark[]" class="form-control" id="inputGroupSuccess1" aria-describedby="inputGroupSuccess1Status" placeholder="{:lang(\'remark\')}"><a href="###" class="input-group-addon delcell" style="color:#FFF; background:#F00;">{:lang(\'delete\')}</a></div></td></tr>';
					$('#yubaoinput').append(html);
				})
					$(document).on('click','.delcell',function(){
						$(this).parents('tr').remove();
					})
					$('.address-del').click(function(){
						var id=$(this).attr('did');
						$.post("{:url('User/addressdel')}",{'id':id},delsuccess);
						return false;
						function delsuccess(data){
							if (data.status) {
								$.thinkbox.success(data.info);
								setTimeout(jumpurl(data.url),1500);
							}else{
								$.thinkbox.error(data.info);
							};
						}
					})
					$('form').submit(function(){
						var self = $(this);
						$.post(self.attr("action"), self.serialize(), success, "json");
						return false;
						function success(data){
							if (data.status) {
								$.thinkbox.success(data.info);
								setTimeout(jumpurl(data.url),1500);
							}else{
								$.thinkbox.error(data.info);
							};
						}
					})
				})
	</script>
</block>